<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<title>账户资金-{$tpshop_config['shop_info_store_title']}</title>
<meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
<meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
<link rel="stylesheet" href="__STATIC__/css/favorite.css">
<link rel="stylesheet" href="__STATIC__/css/jh.css">
</head>
<body> 
<!-- 头部-s -->
<include file="User/header" />
<script src="__PUBLIC__/js/global.js"></script>
<script src="__PUBLIC__/js/pc_common.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script><!-- 弹窗js 参考文档 http://layer.layui.com/-->  
<!-- 头部-e -->
<div class="wrap">
  <div class="bread_crumbs"> <a href="{:U('Home/User/index')}" class="crumbs_font">我的TPshop</a>&gt;<span class="color">我的钱包</span></div>
  <!--菜单--> 
  <include file="User/menu" /> 
  <!--菜单-->     
  <!--侧边导航栏结束-->
   <div class="col_main">
    <div class="main evaluation"> 
      <!-- themes star -->
      <div class="themes_title">
        <h3>我的钱包</h3>
      </div>
      <!-- themes end -->
      <div class="aboutmoney mywallets" style="display:black">
            <div class="usermoney">
                <div class="usertop">
                    <h2>账户概况</h2>
                    <div class="usercontent">
                        <ul class="account-balance">
                            <li>
                                <div class="balance"><p>账户余额</p></div>
                                <div class="account"><h3>￥{$user.user_money}</h3></div>
                                <div class="topup">
                                    <span class="tuchong"><a  onclick="mywalletstopup()">充值</a></span>
                                    <span>|</span>
                                    <span><a href="{:U('Home/User/withdrawals')}">提现</a></span>
                                </div>
                            </li>
                            <li>
                                <div class="balance"><p>积分</p></div>
                                <div class="account"><h3>{$user.pay_points}</h3></div>
                                <div class="topup"><span>100积分=1元</span></div>
                            </li>
                        </ul>
                    </div>
                    <div class="userc">
                        <ul>
                            <li><span>我的账户</span></li>
                            <li><span>我的积分</span></li>
                        </ul>
                    </div>
                </div>
                <div class="userdown">
                    <div class="userdown-top">
                        <ul>
                            <a href="{:U('Home/User/recharge')}"><li <if condition="$_GET['type'] eq ''">class="alllist"</if>>充值记录</li></a>
                            <a href="{:U('Home/User/recharge',array('type'=>1))}"><li <if condition="$_GET['type'] eq 1">class="alllist"</if>>消费记录</li></a>
                        </ul>
                    </div>
                    <hr style="height: 1px; background: #dedede; border: none; margin-top: -2px;" />
                    <if condition="$_GET['type'] neq 1">
                        <div class="userdown-down recharge_log">
                            <div class="ttmt">
                                <ul>
                                    <li>时间</li>
                                    <li>状态</li>
                                    <li>金额</li>
                                    <li>支付方式</li>
                                </ul>
                            </div>
                            <foreach name="recharge_list" item="vo">
                                <div class="ttmt-list">
                                    <ul>
                                        <li>{$vo.ctime|date='Y-m-d H:i:s',###}</li>
                                        <li>
                                            <if condition="$vo[pay_status] eq 0">待支付
                                                <else/>
                                                已支付
                                            </if>
                                        </li>
                                        <li>￥{$vo.account}</li>
                                        <li>{$vo.pay_name}</li>
                                    </ul>
                                </div>
                            </foreach>
                        </div>
                        <div class="operating fixed recharge_log" id="bottom">
                            <div class="fn_page clearfix">
                                {$page}
                            </div>
                        </div>
                    <else/>
                        <div class="userdown-down consume_log">
                            <div class="ttmt">
                                <ul>
                                    <li>消费时间</li>
                                    <li>金额</li>
                                    <li>订单号</li>
                                    <li>描述</li>
                                </ul>
                            </div>
                            <foreach name="consume_list" item="vv">
                                <div class="ttmt-list">
                                    <ul>
                                        <li>{$vv.change_time|date='Y-m-d H:i:s',###}</li>
                                        <li>￥{$vv.user_money}</li>
                                        <li>{$vv.order_sn}</li>
                                        <li>{$vv.desc}</li>
                                    </ul>
                                </div>
                            </foreach>
                        </div>
                        <div class="operating fixed consume_log" id="bottom">
                            <div class="fn_page clearfix">
                                {$page2}
                            </div>
                        </div>
                    </if>
                </div>
            </div>
        </div>
        <div class="aboutmoney addmon" style="display:none">
            <div class="usermoney topup-money">
                <div class="userdown-top network-topup">
                    <ul>
                        <li class="alllist" style="margin-left: -1px">网银充值</li>
                    </ul>
                    <p onclick="mywalletsa();">返回我的钱包</p>
                </div>
                <hr style="height: 1px; background: #dedede; border: none; margin-top: -2px;" />
                <div class="choicetu">
                    <p>选择充值金额：</p>
                    <div class="monettu">
                        <div class="fop-main">
                            <div class="m-tagbox m-multi-tag">
                                <a href="javascript:void(0)" rel="50" class="tag-item">￥50.00<i class="t-check tptig"></i></a>

                                <a href="javascript:void(0)" rel="100" class="tag-item">￥100.00<i class="t-check"></i></a>

                                <a href="javascript:void(0)" rel="200" class="tag-item">￥200.00<i class="t-check"></i></a>

                                <a href="javascript:void(0)" rel="500" class="tag-item">￥500.00<i class="t-check"></i></a>
                                <div class="tag-define" data_id="tag_157">
                                    <span class="define-label" style="display: block;"><i class="i-pen"></i><em>输入金额</em></span>
                                    <input type="text" class="define-input" id="input_val" style="display: none;">
                                </div>
                            </div>
                        </div>
     <div class="fop-choice">
       <form action="" method="post"  id="recharge_form">
        <div class="orde-sjyy">
            <h3 class="titls">选择支付方式</h3>
            <div class="bsjy-g">
                <dl>
                    <dd>
                        <div class="order-payment-area">
                            <div class="dsfzfpte">
                                <b>选择支付方式</b>                               
                            </div>
                             <div class="po-re dsfzf-ee">
                                <ul>
                                	<foreach name="paymentList" item="v"  key="k">      
                                	<li>
			                      	<div class="payment-area">
			                          	<input type="radio"  value="pay_code={$v['code']}" class="radio vam" name="pay_radio" <if condition="$k eq 'alipay'">checked</if>>
			                              <label for="">
			                              	<img src="/plugins/{$v['type']}/{$v['code']}/{$v['icon']}" width="120" height="40" onClick="change_pay(this);" />
			                              </label>
			                          </div>
                                    </li>
                                    </foreach>                              
                                </ul>
                            </div>
                        </div>                         
                    	<!--第三方网银支付 start-->
                    	<foreach name="bankCodeList" item="v"  key="k">
                      	<div class="order-payment-area">
                            <div class="dsfzfpte">
         						<b>{$paymentList[$k]['name']}</b>
                                <em>网银支付</em>
                                </div>
                              <div class="po-re dsfzf-ee">
                                   <ul>
                                   <foreach name="v" item="v2"  key="k2">
                                     <li>
			                           <div class="payment-area">
			                               <input type="radio" name="pay_radio" class="radio vam" value="pay_code={$k}&bank_code={$v2}" id="input-ALIPAY-1">
			                               <label for="">
			                           		<img src="__STATIC__/images/images-out/{$bank_img[$k2]}" width="120" height="40" onClick="change_pay(this);"/>
			                               </label>
			                           </div>
                                      </li>
                                   </foreach>                                                               
                                   </ul>
                               </div> 
                        </div>
                        </foreach>                   
                    <!--第三方网银支付 end -->
                                                                
                    </dd>
                </dl>
                 <input type="hidden" name="account" id="add_money" value="50">
                <div class="order-payment-action-area">                    
                    <a class="button-style-5 button-confirm-payment" href="javascript:void(0);" onclick="recharge_submit();">确认支付方式</a>
                </div>
            	</div>
        		</div>
               </div>
             </div>
           </div>    
          </div>
        </div>
    </div>
  </div>
</div>
<div style="clear: both;"></div>
<include file="User/footer" />

<script>
    $(function () {
         $(".userdown-top ul li").click(function () {
            $(this).addClass('alllist').siblings().removeClass('alllist');
         });
    });
    
    function mywalletsa() {
            $('.mywallets').show();
            $('.addmon').hide();
    };
    function mywalletstopup() {
             $('.addmon').show();
             $('.mywallets').hide();
    };

    $(document).ready(function() {
        $(document).on('click','.tag-item',function(){
            $(this).find('.t-check').addClass('tptig').parent().siblings().find('.t-check').removeClass('tptig');
            $('#add_money').val($(this).attr('rel'));
        });
        $('.tag-define').click(function(){
            var goods_id = $(this).attr('data_id').substr(4);
            $(this).find('.define-label').hide();
            $(this).find('.define-input').show().focus();
            $(this).find('.define-input').blur(function(){
                var ce = $(this).val();
                ce = ce.replace(/\D|^0/g,'')
                           
                $(this).parent('.tag-define').siblings('.tag-item').each(function(){
                    var a_text = $(this).text();
                    if(ce == a_text && ce != ''){
                        alert('已有该标签!');
                        ce = '';
                        $('.define-input').val('');
                    }
                });
                if(ce == ''){
                    $(this).prev('.define-label').show();
                    $(this).hide();
                }else{
                    //remark[{$goods_list.goods_id}][rank]
                    //$(this).parent('.tag-define').prev('.tag-item').after('<input type="hidden" name="remark['+goods_id+'][tag][]" value="'+ce+'"/><a href="javascript:void(0)" class="tag-item">'+'￥'+ ce +'<i class="t-check"></i></a>');
                    //$(this).prev('.define-label').show();
                    //$(this).hide();
                    //$(this).val('');
                }
            })
        });       
    });
    
    
    function recharge_submit(){
    	var input_val = parseInt($('#input_val').val());
    	if(input_val>0){
    		$('#add_money').val(input_val);
    	}
    	var account = $('#add_money').val();
    	if(isNaN(account) || parseInt(account)<=0 || account==''){
    		alert('请输入正确的充值金额');
    		return false;
    	}
    	$('#recharge_form').submit();
    }
    
//    function switchTab(obj,showdiv){
//    	$(obj).siblings().removeClass('alllist');
//    	$(obj).addClass('alllist');
//    	if(showdiv == 'recharge_log'){
//    		$('.recharge_log').show();
//    		$('.consume_log').hide();
//    	}else{
//    		$('.recharge_log').hide();
//    		$('.consume_log').show();
//    	}
//    }
</script>
</body>
</html>